package com.finance.model;

import com.finance.model.types.UserAccountTypeEnum;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "myfinance.userAccount")
@NamedQueries(value = {
    @NamedQuery(name = "readUserAccountByUsername", query = "SELECT ua FROM UserAccount ua WHERE ua.username = :username"),
    @NamedQuery(name = "readAllUserAccounts", query = "SELECT ua FROM UserAccount ua")
})
public class UserAccount implements Serializable {

    private long id;
    private UserAccountTypeEnum type;
    private String username;
    private String password;

    public UserAccount() {
        this.id = -1;
    }

    public UserAccount(long id, UserAccountTypeEnum type, String username, String password) {
        this.id = id;
        this.type = type;
        this.username = username;
        this.password = password;
    }

    @Id
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "userAccountType")
    public UserAccountTypeEnum getType() {
        return type;
    }

    public void setType(UserAccountTypeEnum type) {
        this.type = type;
    }

    @Column
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Column
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
